package com.dingwen.treasure.business.service.impl;

import com.dingwen.treasure.base.constant.PayConstant;
import com.dingwen.treasure.base.pojo.vo.ResultGenerator;
import com.dingwen.treasure.business.service.AbstractPayService;
import com.dingwen.treasure.business.service.PayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 支付宝支付
 *
 * @author dingwen
 * @date 2022/04/25
 */
@SuppressWarnings("ALL")
@Service(value = PayConstant.ZFB_PAY)
@Slf4j
public class ZFBPayServiceImpl extends AbstractPayService implements PayService {
    /**
     * 支付
     */
    @Override
    public void pay() {

        // 执行支付
        execute();

        log.info("zbf pay...");
    }

    /**
     * 获取支付的类型
     *
     * @return {@link String}
     */
    @Override
    public String getPayType() {
        return PayConstant.ZFB_PAY;
    }

    /**
     * 调用三方请求：方法参数灵活完善 </br>
     * <p>抛出异常</p>
     *
     * @return {@link String}
     */
    @Override
    protected String invokeRequest() throws Exception {
        log.info("invokeRequest: 支付宝支付...");
        return ResultGenerator.genSuccessResult().toString();
    }
}
